package com.tanhua.dubbo.api.impl;

import com.tanhua.domain.db.UserStatus;
import com.tanhua.dubbo.api.UserStatusApi;
import com.tanhua.dubbo.mapper.UserStatusMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author: Sword Goddess
 * @Date: 2021/9/18
 * @explain:
 */
@Service
public class UserStatusApiImpl implements UserStatusApi {

    @Autowired
    private UserStatusMapper userStatusMapper;

    /**
     * 冻结用户
     */
    @Override
    public void save(UserStatus userStatus) {
        userStatusMapper.insert(userStatus);
    }


    /**
     * 解冻用户
     */
    @Override
    public void unfreeze(Long userId, String frozenRemarks) {
        userStatusMapper.upDate(userId, frozenRemarks);
    }

    @Override
    public void updateStatus(Long userId) {
        userStatusMapper.updateStatus(userId);
    }


    @Override
    public UserStatus find(Long userId) {
        return userStatusMapper.selectById(userId);
    }

}
